package com.dgshanger.sanhxiaofeisc.ui.home.zxing;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.dgshanger.sanhxiaofeisc.R;



/**
 * author : GJR
 * e-mail : 1203635924@qq.com
 * time   : 2017/06/01
 * desc   :自定义二维码扫描界面
 * version: 1.0
 */
public class ScanActivity extends AppCompatActivity /*implements DecoratedBarcodeView.TorchListener, View.OnClickListener*/ {

    private ImageView mBack;
    /*private CaptureManager captureManager;
    private DecoratedBarcodeView mDBV;*/

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scan);

        mBack= (ImageView) findViewById(R.id.ib_back);
        /*mDBV = (DecoratedBarcodeView) findViewById(R.id.dbv_custom);
        findViewById(R.id.zxing_status_view).setOnClickListener(this);
        mDBV.setTorchListener(this);*/
        //mBack.setOnClickListener(this);

        //重要代码，初始化捕获
       /* captureManager = new CaptureManager(this, mDBV);
        captureManager.initializeFromIntent(getIntent(),savedInstanceState);
        captureManager.decode();*/
    }

   /* @Override
    protected void onPause() {
        super.onPause();
        captureManager.onPause();
    }
*/
    /*@Override
    protected void onResume() {
        super.onResume();
        captureManager.onResume();
    }*/

   /* @Override
    protected void onDestroy() {
        super.onDestroy();
        captureManager.onDestroy();
    }*/

   /* @Override
    public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
        super.onSaveInstanceState(outState, outPersistentState);
        captureManager.onSaveInstanceState(outState);
    }
*/
    /*@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return mDBV.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
    }*/

   /* @Override
    public void onTorchOn() {

    }*/

   /* @Override
    public void onTorchOff() {

    }*/

   /* private boolean isOpen=true;
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ib_back:
                finish();
                break;
           *//* case R.id.zxing_status_view:
                isOpen=!isOpen;
                if (!isOpen){//打开上光灯
                    OpenLightUtils.getInstance().Openshoudian();
                }else {
                    OpenLightUtils.getInstance().flashlightUtils();
                }
                break;*//*
                    default:
                        break;

                }
    }*/

}